package test;

import java.io.File;
import java.sql.SQLException;

import org.nutz.dao.Dao;
import org.nutz.dao.impl.NutDao;

import com.alibaba.druid.pool.DruidDataSource;
import com.ixion.blog.bean.User;

public class Main {
	public static void main(String[] args) throws SQLException, ClassNotFoundException {
		DruidDataSource dataSource = new DruidDataSource();
		File file = new File("D:/Users/贵源/Desktop/blog.db");
		dataSource.setUrl("jdbc:sqlite:/" + file.getPath().toLowerCase().replace("\\", "/"));
		System.out.println(dataSource.getUrl());
		Dao dao = new NutDao(dataSource);
		dao.create(User.class, false);
		dataSource.close();
		// Class.forName("org.sqlite.JDBC");
		// Connection connection =
		// DriverManager.getConnection("jdbc:sqlite:/d:/users/blog.db");
		// System.out.println(connection.isValid(5000));
	}
}
